package com.st.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.st.mapper.StPurchaseRecordsMapper;
import com.st.domain.StPurchaseRecords;
import com.st.service.IStPurchaseRecordsService;

/**
 * 课程购买记录Service业务层处理
 *
 * @author zhw
 * @date 2024-10-24
 */
@Service
public class StPurchaseRecordsServiceImpl extends ServiceImpl<StPurchaseRecordsMapper, StPurchaseRecords> implements IStPurchaseRecordsService {
    @Autowired
    private StPurchaseRecordsMapper stPurchaseRecordsMapper;

    /**
     * 查询课程购买记录
     *
     * @param id 课程购买记录主键
     * @return 课程购买记录
     */
    @Override
    public StPurchaseRecords selectStPurchaseRecordsById(Integer id) {
        return stPurchaseRecordsMapper.selectStPurchaseRecordsById(id);
    }

    /**
     * 查询课程购买记录列表
     *
     * @param stPurchaseRecords 课程购买记录
     * @return 课程购买记录
     */
    @Override
    public List<StPurchaseRecords> selectStPurchaseRecordsList(StPurchaseRecords stPurchaseRecords) {
        return stPurchaseRecordsMapper.selectStPurchaseRecordsList(stPurchaseRecords);
    }

    /**
     * 新增课程购买记录
     *
     * @param stPurchaseRecords 课程购买记录
     * @return 结果
     */
    @Override
    public int insertStPurchaseRecords(StPurchaseRecords stPurchaseRecords) {
            return stPurchaseRecordsMapper.insertStPurchaseRecords(stPurchaseRecords);
    }

    /**
     * 修改课程购买记录
     *
     * @param stPurchaseRecords 课程购买记录
     * @return 结果
     */
    @Override
    public int updateStPurchaseRecords(StPurchaseRecords stPurchaseRecords) {
        return stPurchaseRecordsMapper.updateStPurchaseRecords(stPurchaseRecords);
    }

    /**
     * 批量删除课程购买记录
     *
     * @param ids 需要删除的课程购买记录主键
     * @return 结果
     */
    @Override
    public int deleteStPurchaseRecordsByIds(Integer[] ids) {
        return stPurchaseRecordsMapper.deleteStPurchaseRecordsByIds(ids);
    }

    /**
     * 删除课程购买记录信息
     *
     * @param id 课程购买记录主键
     * @return 结果
     */
    @Override
    public int deleteStPurchaseRecordsById(Integer id) {
        return stPurchaseRecordsMapper.deleteStPurchaseRecordsById(id);
    }
}